<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>评论消息-最美乡村</title>  
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wx/css/detail.css" />
</head>
<body>
<div class="detail">
    <div class="comment voice">
    	<ul>
        <volist name="all" id="vo">
        	<li>
            	<div class="pic">
                    <eq name="vo.u_img" value="">
                <img src="__PUBLIC__/wx/images/pic06.jpg"/>
                    <else/>
                <img src="__PUBLIC__/Uploads/{$vo.u_img}"/>
                    </eq>
                </div>
                <div class="matter">
                	<h4><span>{$vo.nickname}</span><!--<b>地方贤达</b>--><i onClick="replay({$vo.id},'{$vo.nickname}',{$vo.u_id})">回复</i></h4>
                    <p>{$vo.content}</p>
                    <h5><time>{$vo.addtime|date='Y-m-d',###}</time></h5>
            	</div>
                <div class="reply"><span>我：</span><em>{$vo.my_title}</em></div>
            </li>
        </volist>	
        </ul>
    </div>
    <div class="apply" style="display:none;" ><p><input type="hidden" value="0" name="r_u_id" /><input type="hidden" value="0" name="rid" /><input type="text" name="do-comments" placeholder="写评论"/><input type="button" value="发表" onClick="add_comments()"/></p></div>
</div>
</body>
<script type="text/javascript" src="__PUBLIC__/wx/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
//评论
function add_comments(){
	if($("input[name='do-comments']").val()==''){alert("请输入评论！");return;}
	//增加，更新地址
    $.ajax({
    type : "POST",
    dataType : "json",
	data:{r_u_id:$("input[name='r_u_id']").val(),arc_type:'celebrity',arc_id:'{$arc.id}',r_id:$("input[name='rid']").val(),content:$("input[name='do-comments']").val()},
    url: "__MODULE__/Article/comments/",
    async:false,
    success: function(data){
		if(data=='ok'){
			alert("添加成功");
			location.reload();
			}else{
				alert(data);
			}
    }
	});//end ajax
}//end

function replay(id,nickname,r_u_id){
	$(".apply").css('display','block');
	$("input[name='rid']").val(id);	
	$("input[name='r_u_id']").val(r_u_id);	
	$("input[name='do-comments']").attr("placeholder","回复："+nickname);	
}//end fun
</script>
</html>